<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

namespace app\common;

use app\model\activity\coupon\StoreCoupon;

/**
 * 金钱处理工具类
 */
class MoneyTool {
    /**
     * @return OrderTool
     * 静态调用入口
     */
    public static function init() : MoneyTool
    {
        return new static();
    }

    /**
     * 优惠券使用
     */
    public function useCoupon($couponId)
    {
        //优惠券已使用数量加一
        StoreCoupon::where('coupon_id', $couponId)->setDec();
    }

    /**
     * 优惠券退回
     */
    public function refundCoupon()
    {

    }
}